<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h3>用户注册页面</h3>
<div id="app">
    用户名：<input type="text" v-model="user.uname"><br>
    密码:<input type="password" v-model="user.password"><br>
    用户角色:<input type="date" v-model="user.role"><br>
    <input type="button" value="注册" @click="regist">
</div>
<script type="text/javascript">
    var vm =new Vue({
        el :"#app",
        data:{
            user:{
                uid : 0,
            }
        },
        methods:{
            regist(){
                axios.post("/userservice/toregist",this.user).then(function(response){
                    var result = response.data;
                    if(result == "SUCC"){
                        location.href="/userservice/login";
                    }else{
                        alert("注册异常");
                    }
                });
            }
        },
        created(){
            this.findDept();
        }
    });

</script>
</body>
</html>